﻿package mortal.game.view.group.groupAvatar
{
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import com.mui.manager.*;
    import extend.language.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class BtnShowTeamAvatar extends ToolTipSprite
    {
        private var _hideBtn:GLoadedButton;
        private var _bg:ScaleBitmap;
        private var _title:GTextFiled;

        public function BtnShowTeamAvatar()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            buttonMode = true;
            this._hideBtn = UIFactory.gLoadedButton(ImagesConst.PrevPageBtn_upSkin, 1, 1, 17, 18, this);
            this._hideBtn.label = "";
            this._bg = UIFactory.bg(0, 0, 20, 100, this, ImagesConst.ComboBox);
            this._title = UIFactory.gTextField(Language.getString(30255), 2, 20, 20, 80, this);
            this._title.wordWrap = true;
            this._title.multiline = true;
            this.show = true;
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._hideBtn.dispose(param1);
            this._hideBtn = null;
            this._bg.dispose(param1);
            this._bg = null;
            this._title.dispose(param1);
            this._title = null;
            super.disposeImpl(param1);
            return;
        }// end function

        public function set show(param1:Boolean) : void
        {
            if (param1)
            {
                toolTipData = HTMLUtil.addColor(Language.getString(30254), "#ffffff");
                this._hideBtn.styleName = ImagesConst.PrevPageBtn_upSkin;
                if (contains(this._bg))
                {
                    removeChild(this._bg);
                }
                if (contains(this._title))
                {
                    removeChild(this._title);
                }
            }
            else
            {
                toolTipData = HTMLUtil.addColor(Language.getString(30255), "#ffffff");
                this._hideBtn.styleName = ImagesConst.NextPageBtn_upSkin;
                if (!contains(this._bg))
                {
                    addChildAt(this._bg, 0);
                }
                if (!contains(this._title))
                {
                    addChild(this._title);
                }
            }
            return;
        }// end function

    }
}
